import 'package:cateapp/generated/json/base/juejin_list_entity.dart';

juejinListEntityFromJson(JuejinListEntity data, Map<String, dynamic> json) {
	if (json['err_no'] != null) {
		data.errNo = json['err_no']?.toInt();
	}
	if (json['err_msg'] != null) {
		data.errMsg = json['err_msg']?.toString();
	}
	if (json['data'] != null) {
		data.data = new List<JuejinListData>();
		(json['data'] as List).forEach((v) {
			data.data.add(new JuejinListData().fromJson(v));
		});
	}
	return data;
}

Map<String, dynamic> juejinListEntityToJson(JuejinListEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['err_no'] = entity.errNo;
	data['err_msg'] = entity.errMsg;
	if (entity.data != null) {
		data['data'] =  entity.data.map((v) => v.toJson()).toList();
	}
	return data;
}

juejinListDataFromJson(JuejinListData data, Map<String, dynamic> json) {
	if (json['article_id'] != null) {
		data.articleId = json['article_id']?.toString();
	}
	if (json['article_info'] != null) {
		data.articleInfo = new JuejinListDataArticleInfo().fromJson(json['article_info']);
	}
	if (json['author_user_info'] != null) {
		data.authorUserInfo = new JuejinListDataAuthorUserInfo().fromJson(json['author_user_info']);
	}
	if (json['category'] != null) {
		data.category = new JuejinListDataCategory().fromJson(json['category']);
	}
	if (json['tags'] != null) {
		data.tags = new List<JuejinListDataTag>();
		(json['tags'] as List).forEach((v) {
			data.tags.add(new JuejinListDataTag().fromJson(v));
		});
	}
	if (json['user_interact'] != null) {
		data.userInteract = new JuejinListDataUserInteract().fromJson(json['user_interact']);
	}
	if (json['org'] != null) {
		data.org = new JuejinListDataOrg().fromJson(json['org']);
	}
	return data;
}

Map<String, dynamic> juejinListDataToJson(JuejinListData entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['article_id'] = entity.articleId;
	if (entity.articleInfo != null) {
		data['article_info'] = entity.articleInfo.toJson();
	}
	if (entity.authorUserInfo != null) {
		data['author_user_info'] = entity.authorUserInfo.toJson();
	}
	if (entity.category != null) {
		data['category'] = entity.category.toJson();
	}
	if (entity.tags != null) {
		data['tags'] =  entity.tags.map((v) => v.toJson()).toList();
	}
	if (entity.userInteract != null) {
		data['user_interact'] = entity.userInteract.toJson();
	}
	if (entity.org != null) {
		data['org'] = entity.org.toJson();
	}
	return data;
}

juejinListDataArticleInfoFromJson(JuejinListDataArticleInfo data, Map<String, dynamic> json) {
	if (json['article_id'] != null) {
		data.articleId = json['article_id']?.toString();
	}
	if (json['user_id'] != null) {
		data.userId = json['user_id']?.toString();
	}
	if (json['category_id'] != null) {
		data.categoryId = json['category_id']?.toString();
	}
	if (json['tag_ids'] != null) {
		data.tagIds = json['tag_ids']?.map((v) => v?.toInt())?.toList()?.cast<int>();
	}
	if (json['visible_level'] != null) {
		data.visibleLevel = json['visible_level']?.toInt();
	}
	if (json['link_url'] != null) {
		data.linkUrl = json['link_url']?.toString();
	}
	if (json['cover_image'] != null) {
		data.coverImage = json['cover_image']?.toString();
	}
	if (json['is_gfw'] != null) {
		data.isGfw = json['is_gfw']?.toInt();
	}
	if (json['title'] != null) {
		data.title = json['title']?.toString();
	}
	if (json['brief_content'] != null) {
		data.briefContent = json['brief_content']?.toString();
	}
	if (json['is_english'] != null) {
		data.isEnglish = json['is_english']?.toInt();
	}
	if (json['is_original'] != null) {
		data.isOriginal = json['is_original']?.toInt();
	}
	if (json['user_index'] != null) {
		data.userIndex = json['user_index']?.toInt();
	}
	if (json['original_type'] != null) {
		data.originalType = json['original_type']?.toInt();
	}
	if (json['original_author'] != null) {
		data.originalAuthor = json['original_author']?.toString();
	}
	if (json['content'] != null) {
		data.content = json['content']?.toString();
	}
	if (json['ctime'] != null) {
		data.ctime = json['ctime']?.toString();
	}
	if (json['mtime'] != null) {
		data.mtime = json['mtime']?.toString();
	}
	if (json['rtime'] != null) {
		data.rtime = json['rtime']?.toString();
	}
	if (json['draft_id'] != null) {
		data.draftId = json['draft_id']?.toString();
	}
	if (json['view_count'] != null) {
		data.viewCount = json['view_count']?.toInt();
	}
	if (json['collect_count'] != null) {
		data.collectCount = json['collect_count']?.toInt();
	}
	if (json['digg_count'] != null) {
		data.diggCount = json['digg_count']?.toInt();
	}
	if (json['comment_count'] != null) {
		data.commentCount = json['comment_count']?.toInt();
	}
	if (json['hot_index'] != null) {
		data.hotIndex = json['hot_index']?.toInt();
	}
	if (json['is_hot'] != null) {
		data.isHot = json['is_hot']?.toInt();
	}
	if (json['rank_index'] != null) {
		data.rankIndex = json['rank_index']?.toDouble();
	}
	if (json['status'] != null) {
		data.status = json['status']?.toInt();
	}
	if (json['verify_status'] != null) {
		data.verifyStatus = json['verify_status']?.toInt();
	}
	if (json['audit_status'] != null) {
		data.auditStatus = json['audit_status']?.toInt();
	}
	if (json['mark_content'] != null) {
		data.markContent = json['mark_content']?.toString();
	}
	return data;
}

Map<String, dynamic> juejinListDataArticleInfoToJson(JuejinListDataArticleInfo entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['article_id'] = entity.articleId;
	data['user_id'] = entity.userId;
	data['category_id'] = entity.categoryId;
	data['tag_ids'] = entity.tagIds;
	data['visible_level'] = entity.visibleLevel;
	data['link_url'] = entity.linkUrl;
	data['cover_image'] = entity.coverImage;
	data['is_gfw'] = entity.isGfw;
	data['title'] = entity.title;
	data['brief_content'] = entity.briefContent;
	data['is_english'] = entity.isEnglish;
	data['is_original'] = entity.isOriginal;
	data['user_index'] = entity.userIndex;
	data['original_type'] = entity.originalType;
	data['original_author'] = entity.originalAuthor;
	data['content'] = entity.content;
	data['ctime'] = entity.ctime;
	data['mtime'] = entity.mtime;
	data['rtime'] = entity.rtime;
	data['draft_id'] = entity.draftId;
	data['view_count'] = entity.viewCount;
	data['collect_count'] = entity.collectCount;
	data['digg_count'] = entity.diggCount;
	data['comment_count'] = entity.commentCount;
	data['hot_index'] = entity.hotIndex;
	data['is_hot'] = entity.isHot;
	data['rank_index'] = entity.rankIndex;
	data['status'] = entity.status;
	data['verify_status'] = entity.verifyStatus;
	data['audit_status'] = entity.auditStatus;
	data['mark_content'] = entity.markContent;
	return data;
}

juejinListDataAuthorUserInfoFromJson(JuejinListDataAuthorUserInfo data, Map<String, dynamic> json) {
	if (json['user_id'] != null) {
		data.userId = json['user_id']?.toString();
	}
	if (json['user_name'] != null) {
		data.userName = json['user_name']?.toString();
	}
	if (json['company'] != null) {
		data.company = json['company']?.toString();
	}
	if (json['job_title'] != null) {
		data.jobTitle = json['job_title']?.toString();
	}
	if (json['avatar_large'] != null) {
		data.avatarLarge = json['avatar_large']?.toString();
	}
	if (json['level'] != null) {
		data.level = json['level']?.toInt();
	}
	if (json['description'] != null) {
		data.description = json['description']?.toString();
	}
	if (json['followee_count'] != null) {
		data.followeeCount = json['followee_count']?.toInt();
	}
	if (json['follower_count'] != null) {
		data.followerCount = json['follower_count']?.toInt();
	}
	if (json['post_article_count'] != null) {
		data.postArticleCount = json['post_article_count']?.toInt();
	}
	if (json['digg_article_count'] != null) {
		data.diggArticleCount = json['digg_article_count']?.toInt();
	}
	if (json['got_digg_count'] != null) {
		data.gotDiggCount = json['got_digg_count']?.toInt();
	}
	if (json['got_view_count'] != null) {
		data.gotViewCount = json['got_view_count']?.toInt();
	}
	if (json['post_shortmsg_count'] != null) {
		data.postShortmsgCount = json['post_shortmsg_count']?.toInt();
	}
	if (json['digg_shortmsg_count'] != null) {
		data.diggShortmsgCount = json['digg_shortmsg_count']?.toInt();
	}
	if (json['isfollowed'] != null) {
		data.isfollowed = json['isfollowed'];
	}
	if (json['favorable_author'] != null) {
		data.favorableAuthor = json['favorable_author']?.toInt();
	}
	if (json['power'] != null) {
		data.power = json['power']?.toInt();
	}
	if (json['study_point'] != null) {
		data.studyPoint = json['study_point']?.toInt();
	}
	if (json['university'] != null) {
		data.university = new JuejinListDataAuthorUserInfoUniversity().fromJson(json['university']);
	}
	if (json['major'] != null) {
		data.major = new JuejinListDataAuthorUserInfoMajor().fromJson(json['major']);
	}
	if (json['student_status'] != null) {
		data.studentStatus = json['student_status']?.toInt();
	}
	if (json['select_event_count'] != null) {
		data.selectEventCount = json['select_event_count']?.toInt();
	}
	if (json['select_online_course_count'] != null) {
		data.selectOnlineCourseCount = json['select_online_course_count']?.toInt();
	}
	if (json['identity'] != null) {
		data.identity = json['identity']?.toInt();
	}
	if (json['is_select_annual'] != null) {
		data.isSelectAnnual = json['is_select_annual'];
	}
	if (json['select_annual_rank'] != null) {
		data.selectAnnualRank = json['select_annual_rank']?.toInt();
	}
	if (json['annual_list_type'] != null) {
		data.annualListType = json['annual_list_type']?.toInt();
	}
	return data;
}

Map<String, dynamic> juejinListDataAuthorUserInfoToJson(JuejinListDataAuthorUserInfo entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['user_id'] = entity.userId;
	data['user_name'] = entity.userName;
	data['company'] = entity.company;
	data['job_title'] = entity.jobTitle;
	data['avatar_large'] = entity.avatarLarge;
	data['level'] = entity.level;
	data['description'] = entity.description;
	data['followee_count'] = entity.followeeCount;
	data['follower_count'] = entity.followerCount;
	data['post_article_count'] = entity.postArticleCount;
	data['digg_article_count'] = entity.diggArticleCount;
	data['got_digg_count'] = entity.gotDiggCount;
	data['got_view_count'] = entity.gotViewCount;
	data['post_shortmsg_count'] = entity.postShortmsgCount;
	data['digg_shortmsg_count'] = entity.diggShortmsgCount;
	data['isfollowed'] = entity.isfollowed;
	data['favorable_author'] = entity.favorableAuthor;
	data['power'] = entity.power;
	data['study_point'] = entity.studyPoint;
	if (entity.university != null) {
		data['university'] = entity.university.toJson();
	}
	if (entity.major != null) {
		data['major'] = entity.major.toJson();
	}
	data['student_status'] = entity.studentStatus;
	data['select_event_count'] = entity.selectEventCount;
	data['select_online_course_count'] = entity.selectOnlineCourseCount;
	data['identity'] = entity.identity;
	data['is_select_annual'] = entity.isSelectAnnual;
	data['select_annual_rank'] = entity.selectAnnualRank;
	data['annual_list_type'] = entity.annualListType;
	return data;
}

juejinListDataAuthorUserInfoUniversityFromJson(JuejinListDataAuthorUserInfoUniversity data, Map<String, dynamic> json) {
	if (json['university_id'] != null) {
		data.universityId = json['university_id']?.toString();
	}
	if (json['name'] != null) {
		data.name = json['name']?.toString();
	}
	if (json['logo'] != null) {
		data.logo = json['logo']?.toString();
	}
	return data;
}

Map<String, dynamic> juejinListDataAuthorUserInfoUniversityToJson(JuejinListDataAuthorUserInfoUniversity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['university_id'] = entity.universityId;
	data['name'] = entity.name;
	data['logo'] = entity.logo;
	return data;
}

juejinListDataAuthorUserInfoMajorFromJson(JuejinListDataAuthorUserInfoMajor data, Map<String, dynamic> json) {
	if (json['major_id'] != null) {
		data.majorId = json['major_id']?.toString();
	}
	if (json['parent_id'] != null) {
		data.parentId = json['parent_id']?.toString();
	}
	if (json['name'] != null) {
		data.name = json['name']?.toString();
	}
	return data;
}

Map<String, dynamic> juejinListDataAuthorUserInfoMajorToJson(JuejinListDataAuthorUserInfoMajor entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['major_id'] = entity.majorId;
	data['parent_id'] = entity.parentId;
	data['name'] = entity.name;
	return data;
}

juejinListDataCategoryFromJson(JuejinListDataCategory data, Map<String, dynamic> json) {
	if (json['category_id'] != null) {
		data.categoryId = json['category_id']?.toString();
	}
	if (json['category_name'] != null) {
		data.categoryName = json['category_name']?.toString();
	}
	if (json['category_url'] != null) {
		data.categoryUrl = json['category_url']?.toString();
	}
	if (json['rank'] != null) {
		data.rank = json['rank']?.toInt();
	}
	if (json['ctime'] != null) {
		data.ctime = json['ctime']?.toInt();
	}
	if (json['mtime'] != null) {
		data.mtime = json['mtime']?.toInt();
	}
	if (json['show_type'] != null) {
		data.showType = json['show_type']?.toInt();
	}
	return data;
}

Map<String, dynamic> juejinListDataCategoryToJson(JuejinListDataCategory entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['category_id'] = entity.categoryId;
	data['category_name'] = entity.categoryName;
	data['category_url'] = entity.categoryUrl;
	data['rank'] = entity.rank;
	data['ctime'] = entity.ctime;
	data['mtime'] = entity.mtime;
	data['show_type'] = entity.showType;
	return data;
}

juejinListDataTagFromJson(JuejinListDataTag data, Map<String, dynamic> json) {
	if (json['id'] != null) {
		data.id = json['id']?.toInt();
	}
	if (json['tag_id'] != null) {
		data.tagId = json['tag_id']?.toString();
	}
	if (json['tag_name'] != null) {
		data.tagName = json['tag_name']?.toString();
	}
	if (json['color'] != null) {
		data.color = json['color']?.toString();
	}
	if (json['icon'] != null) {
		data.icon = json['icon']?.toString();
	}
	if (json['back_ground'] != null) {
		data.backGround = json['back_ground']?.toString();
	}
	if (json['show_navi'] != null) {
		data.showNavi = json['show_navi']?.toInt();
	}
	if (json['ctime'] != null) {
		data.ctime = json['ctime']?.toInt();
	}
	if (json['mtime'] != null) {
		data.mtime = json['mtime']?.toInt();
	}
	if (json['id_type'] != null) {
		data.idType = json['id_type']?.toInt();
	}
	if (json['tag_alias'] != null) {
		data.tagAlias = json['tag_alias']?.toString();
	}
	if (json['post_article_count'] != null) {
		data.postArticleCount = json['post_article_count']?.toInt();
	}
	if (json['concern_user_count'] != null) {
		data.concernUserCount = json['concern_user_count']?.toInt();
	}
	return data;
}

Map<String, dynamic> juejinListDataTagToJson(JuejinListDataTag entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['id'] = entity.id;
	data['tag_id'] = entity.tagId;
	data['tag_name'] = entity.tagName;
	data['color'] = entity.color;
	data['icon'] = entity.icon;
	data['back_ground'] = entity.backGround;
	data['show_navi'] = entity.showNavi;
	data['ctime'] = entity.ctime;
	data['mtime'] = entity.mtime;
	data['id_type'] = entity.idType;
	data['tag_alias'] = entity.tagAlias;
	data['post_article_count'] = entity.postArticleCount;
	data['concern_user_count'] = entity.concernUserCount;
	return data;
}

juejinListDataUserInteractFromJson(JuejinListDataUserInteract data, Map<String, dynamic> json) {
	if (json['id'] != null) {
		data.id = json['id']?.toInt();
	}
	if (json['omitempty'] != null) {
		data.omitempty = json['omitempty']?.toInt();
	}
	if (json['user_id'] != null) {
		data.userId = json['user_id']?.toInt();
	}
	if (json['is_digg'] != null) {
		data.isDigg = json['is_digg'];
	}
	if (json['is_follow'] != null) {
		data.isFollow = json['is_follow'];
	}
	if (json['is_collect'] != null) {
		data.isCollect = json['is_collect'];
	}
	return data;
}

Map<String, dynamic> juejinListDataUserInteractToJson(JuejinListDataUserInteract entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['id'] = entity.id;
	data['omitempty'] = entity.omitempty;
	data['user_id'] = entity.userId;
	data['is_digg'] = entity.isDigg;
	data['is_follow'] = entity.isFollow;
	data['is_collect'] = entity.isCollect;
	return data;
}

juejinListDataOrgFromJson(JuejinListDataOrg data, Map<String, dynamic> json) {
	if (json['org_info'] != null) {
		data.orgInfo = json['org_info'];
	}
	if (json['org_user'] != null) {
		data.orgUser = json['org_user'];
	}
	if (json['is_followed'] != null) {
		data.isFollowed = json['is_followed'];
	}
	return data;
}

Map<String, dynamic> juejinListDataOrgToJson(JuejinListDataOrg entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['org_info'] = entity.orgInfo;
	data['org_user'] = entity.orgUser;
	data['is_followed'] = entity.isFollowed;
	return data;
}